package com.yms.juc.threadLocal;

import java.util.concurrent.TimeUnit;

/**
 * @version : 1.0
 * @author: yangmingsong
 * @date: 2022/7/17-07-17-17:51
 * @description: spring5Test
 */
public class Test {
    private  static  ThreadLocal<String> local = new ThreadLocal<>();
    public static void main(String[] args) throws InterruptedException {
        new Thread(()->{
            local.set("123");
            System.out.println(local.get());
        }).start();
        new Thread(()->{
            local.set("456");
            System.out.println(local.get());
        }).start();
        TimeUnit.SECONDS.sleep(5);
        System.out.println(local.get());
    }


}
